﻿namespace GoodAdmin.CodeGenerator;

/// <summary>
/// 代码生成基础信息
/// </summary>
[SugarTable("CodeGenData")]
public class CodeGenData : BaseEntity
{
    /// <summary>
    /// 名称
    /// </summary>
    [SugarColumn(ColumnDescription = "名称")]
    public virtual string Name { get; set; }    
    /// <summary>
    /// 编码
    /// </summary>
    [SugarColumn(ColumnDescription = "编码")]
    public virtual string Code { get; set; }
    /// <summary>
    /// 数据库ID
    /// </summary>
    [SugarColumn(ColumnDescription = "数据库ID")]
    public string ConfigId { get; set; }
    /// <summary>
    /// 类型
    /// Web设计,App设计,流程表单,Web表单,App表单.
    /// </summary>
    [SugarColumn(ColumnDescription = "类型",Length =20)]
    public virtual string Type { get; set; }
    /// <summary>
    /// 分类
    /// </summary>
    [SugarColumn(ColumnDescription = "分类", Length = 50)]
    public virtual string Category { get; set; }
    /// <summary>
    /// 描述
    /// </summary>
    [SugarColumn(ColumnDescription = "描述", Length = 200)]
    public string Description { get; set; }
    /// <summary>
    /// 数据表信息
    /// </summary>
    [SugarColumn(ColumnDescription = "数据表信息", IsJson = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public List<TableInfo> TableInfoList { get; set; }
    
    /// <summary>
    /// 表单信息
    /// </summary>
    [SugarColumn(ColumnDescription = "表单信息", IsJson = true, ColumnDataType = StaticConfig.CodeFirst_BigString, IsIgnore = true)]
    public string FormData { get; set; }
    /// <summary>
    /// 列表展示信息
    /// </summary>
    [SugarColumn(ColumnDescription = "列表展示信息", IsJson = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string ListData { get; set; }
}

public class TableInfo
{
    /// <summary>
    /// 表名
    /// </summary>
    [SugarColumn(ColumnDescription = "表名", Length = 100)]
    public string Name { get; set; }
    /// <summary>
    /// 表描述
    /// </summary>
    [SugarColumn(ColumnDescription = "表描述", Length = 100)]
    public string Description { get; set; }
    /// <summary>
    /// 类型
    /// 主表，子表
    /// </summary>
    [SugarColumn(ColumnDescription = "类型", Length = 20)]
    public string TableType { get; set; }

}

